package com.atqinke.designpattern.structuraltype.decorator;

/**
 * @BelongsProject: BasicConnection
 * @BelongsPackage: com.atqinke.DesignPattern.structuraltype.decorator
 * @Author: NieHk
 * @CreateTime: 2022-08-26  17:15
 * @Description: 培根类
 * @Version: 1.0
 */
public class Bacon extends Garnish {

    public Bacon(FastFood fastFood) {
        super(fastFood,2,"培根");
    }

//    public float cost() {
//        //计算价格
//        return getPrice() + getFastFood().cost();
//    }

    @Override
    public float getPrice() {
        return super.getPrice() + getFastFood().getPrice();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
